<h2>Cart Items</h2>

<p>
    <a [routerLink]="['/shipping']">Check the shipping price</a>
</p>

<div class="cart-item" *ngFor="let item of items">
    <span *ngIf="item.name">{{item.name}}</span>
    <span *ngIf="item.price">{{item.price | currency}}</span>
</div>

<div *ngIf="items && items.length > 0">
    <form [formGroup]="checkoutForm" (ngSubmit)="onSubmit()">
        <div>
            <label for="name">Name</label>
            <input id="name" type="text" formControlName="name" />
        </div>

        <div>
            <label for="address">Address</label>
            <input id="address" type="text" formControlName="address" />
        </div>

        <button class="button" type="submit">Purchase</button>
    </form>
</div>